home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / 422mods.zip / DAWG03B.422 < prev    next >
Text File  |  1993-02-16  |  6KB  |  125 lines

  1. 1[2DAWG03B.MOD1] 0 Time Compensation For Posting
  2. Dawg #1 @13498
  3. Sun Feb 14 00:23:25 1993
  4. ╔══════════════════════════════════════════════════════════════════════════╗
  5. ║ MOD     :DAWG03B.MOD - Time Compensation For Posts                       ║
  6. ║ DATE    :02/14/93                                                        ║
  7. ║ USAGE   :WWIV 4.22                                                       ║
  8. ║ VERSION :1.20                                                            ║
  9. ║ Descrip.:Gives posters their time back for posting.                      ║
  10. ║ Diff.   :2  (on a scale of 1-10, 1 being easy)                           ║
  11. ║ Author  :6Dawg0   116@134722/116@1134980                                           ║
  12. ║ BBS     :6Thunder2world0                                                    ║
  13. ║ Thanx to:4Fish7Bone0 of 7Star4Base0 4Fish7Bone0 (3478 net/13454 link)             ║
  14. ║            for beta testing this mod and for his countless suggestions   ║
  15. ║            some of which were implemented.                               ║
  16. ║          1Tolkien0 of the 1Fellowship0 (3456 net) for the basic idea.        ║
  17. ╚══════════════════════════════════════════════════════════════════════════╝
  18. Okay here is DAWG03B.MOD.  It it a time compensation mod for posts.
  19. Basically this mod came from Too $hort (no longer in the net), and the basic
  20. idea came from Tolkien (1@3456 net).  Now that we have that out of the way,
  21. on to the mod.  Basically Too $hort's mod is a good mod;  however, there were
  22. a couple of things I didn't like about it.  One is that it gave the time back
  23. for posts but also email.  I have taken care of that, although if you delete
  24. two small lines you can put it back in.  Also, it only told how many minutes
  25. of time it gave back.  Basically nothing wrong with that, but it looked weird
  26. if a post took less than one minute.  The last thing was that while I am not
  27. really a 'C' programmer, I do have a decent knowledge of Pascal.  Well I
  28. decided that the Div command would be much more workable and require less
  29. code that Too $hort's method.  I then looked through the commands for 'C'.
  30. Much to my suprise, the Div command in 'C' is much nicer than the one I used
  31. in Pascal.  It returns the quotient and remainder.  Makes the mod much more
  32. simple and takes less code.
  33.  
  34. Please back up your source first.  This is a simple mod, but in case
  35. something goes wrong you will have a working copy that way.
  36.  
  37. This mod does NOT remove time for posts removed.  The reason is that it only
  38. gives the amount of time spent on making the post.  So they are only getting
  39. reimbursed for the whole time spent on making a post.  Nothing extra (although
  40. it would be simple to do that as well), so if they post just to get bonus
  41. time, they aren't doing theyselves any good.
  42.  
  43.  
  44. ============================================================================
  45. Revision history:
  46.  
  47. rev 1.0 - Original mod, worked pretty well.  Released as Dawg03.Mod.
  48.  
  49. rev 1.1 - Rewritten to use less code.  More efficient as well.  Made sure
  50.       it's compatible with 4.20e.  Released as Dawg03a.Mod.
  51.  
  52. rev 1.2 - Made sure it's compatible with 4.22.  Released as Dawg03b.Mod.
  53. ============================================================================
  54.  
  55. The entire mod is in void inmsg which is in MSGBASE.C.  You need to add the
  56. following to the variable declarations at the top.
  57.  
  58. -------------------------------------------------------------
  59.  
  60.   double start,end,totalt;  /* ADD */
  61.   div_t tcomp;              /* ADD */
  62.  
  63. -------------------------------------------------------------
  64.  
  65. Then add this line immediately after all the declarations
  66. -------------------------------------------------------------
  67.  
  68.   start=nsl();     /*ADD*/
  69.  
  70. -------------------------------------------------------------
  71.  
  72. Now here is the bulk of the code.  I would suggest block reading it in.
  73. ---------------------------------------------------------------
  74.  
  75.  
  76.     outstr(get_string(91));  /*existing line*/
  77.  
  78. /***********************************************************************/
  79. /***  Add this entire section of code.                               ***/
  80. /***********************************************************************/
  81.     nl();
  82.     end=nsl();
  83.     totalt=start-end;
  84.     tcomp=div(totalt,60);
  85.     if (strcmp(aux,"EMAIL")!=0) {    /* Note 1 */
  86.       if (tcomp.quot!=0) {
  87.     sprintf(s,"1Granted  2%u 1Minute",tcomp.quot);
  88.     if (tcomp.quot!=1)
  89.       strcat(s,"1s");
  90.       strcat(s,"1 and");
  91.       } else
  92.     strcpy(s,"1Granted");
  93.       if (tcomp.rem!=0) {
  94.     sprintf(s1," 2%u 1Second",tcomp.rem);
  95.     if (tcomp.rem!=1)
  96.       strcat(s1,"1s");
  97.       }
  98.       strcat(s1," for that post.");
  99.       strcat(s,s1);
  100.       pl(s);
  101.       thisuser.extratime+=totalt;
  102.     } /* NOTE 1 */
  103. /*************************************************************************/
  104. /***  Original code starts back up here                                ***/
  105. /*************************************************************************/
  106.     if (fsed) {
  107.  
  108. ---------------------------------------------------------------------------
  109.  
  110. Okay, I did not want to give time compensation for emails.  If you
  111. wish to do that, just delete the two lines that say /* NOTE 1 */.  That
  112. will then give compensation for emails and feedbacks.
  113.  
  114.  
  115. Well a couple of things here:
  116.  
  117. 1) BACK UP YOUR SOURCE!
  118. 2) I am NOT RESPONSIBLE if (insert your favorite disaster here)!
  119. 3) I will provide any help I can if you need it.  Feel free to email me
  120.     at either of the above addresses.
  121.  
  122. Well that's all for now!
  123.  
  124.                6DAWG
  125.